import cv2
import numpy as np

img = cv2.imread('xianRenZhang.jpg')
k = np.ones((5, 5), np.uint8)
cv2.imshow('src', img)
dst = cv2.erode(img, k)
cv2.imshow('dst', dst)
cv2.waitKey()
cv2.destroyAllWindows()
